#ifndef __USER_BT_PBAP_H__
#define __USER_BT_PBAP_H__

#include <stdint.h>
#include <stddef.h>
#include <string.h>
#include <assert.h>
#include <stdbool.h>

#define PBAP_FUC    1

#if (PBAP_FUC == 1)
void user_set_pbap_state(uint8_t sta);
void user_pbap_data_parse(uint8_t *buffer, uint16_t len);
void pbap_data_pull_completed(uint32_t oper);
void user_connect_pbap_client(void);
uint8_t user_get_pbap_state(void);
void user_pull_phonebook(uint8_t phonetype,uint16_t list_offset,uint16_t maxlist);
uint32_t user_get_phone_book_total(void);
uint8_t user_get_phone_book_info(uint8_t id,uint8_t *name,uint8_t *number,uint8_t *n_len);
void flash_wr_test(void);
void user_del_pbap_info(void);

void call_record_list_parse_save(uint8_t *param,uint8_t len);
uint8_t user_find_phonebook_name(uint8_t * call_buffer,uint16_t call_len,uint8_t * name,uint8_t * name_len);

#define     PHONE_BOOK_START_ADDRESS      0xF80000//  (FLASH_START_ADDRESS+0x1000)
#define     PHONE_BOOK_END_ADDRESS        (PHONE_BOOK_START_ADDRESS+0x10000)//  (FLASH_START_ADDRESS+0x10000) 

#endif

/*---------------------------------------------------------------------------
 * Pull Phone Type
 */
enum pull_phone_type_t
{
    PhoneBookList,
    IncomingCallList,    
    OutgoingCallList,
    MissCallList,
    CombinedCallList,
    SpeedDialList,
    FavoriteNumberList,
};

typedef struct _Pbap_Vcard_Filter 
{
    /* Array of 8 bytes for this 64-bit filter value */
    uint8_t                  byte[8];
} Pbap_Vcard_Filter;

#endif  /* __APP_PBAP_H__ */